package logic

import (
	"context"
	"merchantmanager/models/mysql"

	"merchantmanager/merrpc/internal/svc"
	"merchantmanager/merrpc/merrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type MerDelLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewMerDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MerDelLogic {
	return &MerDelLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *MerDelLogic) MerDel(in *merrpc.MerDelRequest) (*merrpc.MerDelResponse, error) {
	// todo: add your logic here and delete this line
	mysql.DB.Debug().Where("id =?", in.Id).Delete(&mysql.Merchants{})
	return &merrpc.MerDelResponse{}, nil
}
